#ifndef NETWORKFACTORY_H
#define NETWORKFACTORY_H

#include <assert.h>
#include "socket/protocol/Command.h"
#include "socket/protocol/CarRequestPassenger.h"

#include "ccarlogin.h"
#include "ccarRequestPassenger.h"
#include "ccarquestorder.h"

class INetWorking;

class CNetworkFactory
{
public:
    static INetWorking* getNetworkClass(int command)
    {
        switch (command)
        {
        case protocal::CAR_LOGIN:
            return (new CCarLogin);
            break;

        case protocal::CAR_REQUEST_PASSENGERS:
            return (new CCarRequestPassengers);
            break;

        case protocal::CAR_CHOOSE_CLIENT:
            return (new CCarRequestOrder);
            break;

        default:
            assert(0);
            break;
        }
    }
};

#endif // NETWORKFACTORY_H
